import type { RouteRecordRaw } from 'vue-router';
// 同步路由
export const asyncRoutes: Array<RouteRecordRaw> = [

  {
    path: '/',
    redirect: '/index'
  },
  // 首页
  {
    path: '/index',
    name: 'index',
    component: () => import('../views/index/index.vue'),
    meta: {
      isHidden: false
    }
  },
  // 个人中心 - 用户
  {
    path: '/user',
    name: 'personalCenter',
    component: () => import('@/views/personalCenter/index.vue'),
    meta: {
      isHidden: false
    }
  },
  // 分类
  {
    path: "/item/cateList",
    name: 'category',
    component: () => import('@/views/category/index.vue'),
    meta: {
      isHidden: false
    }
  },
  {
    path: '/categoryItem',
    name: 'categoryItem',
    component: () => import('@/views/categoryItem/index.vue')
  },
  // 值得做
  {
    path: '/topic/index',
    name: 'valuable',
    component: () => import('@/views/valuable/index.vue'),
    meta: {
      isHidden: false
    }
  },
  // 购物车
  {
    path: '/item/cart',
    name: 'shopCart',
    component: () => import('@/views/shopCart/index.vue'),
    meta: {
      isHidden: false
    }
  },
  // 地址
  {
    path: '/cart/address',
    name: 'address',
    component: () => import('@/views/shopCart/address/index.vue')
  },
  //新增收货地址
  {
    path: '/cart/addOrSet',
    name: 'addOrSet',
    component: () => import('@/views/shopCart/AddOrSet/index.vue')
  },
  //支付
  {
    path: '/cart/pay',
    name: 'pay',
    component: () => import('@/views/shopCart/pay/index.vue')
  },
  // 搜索
  {
    path: '/search',
    name: 'search',
    component: () => import('@/views/search/index.vue'),
    meta: {
      isHidden: true
    }
  },
  ,
  //登录
  {
    path: '/u/login',
    name: 'login',
    component: () => import('@/components/login/index.vue'),
    meta: {
      isHidden: true
    }
  },
  //注册
  {
    path: '/appleid',
    name: 'apple',
    component: () => import('@/views/appleid/index.vue'),
    meta: {
      isHidden: true
    }
  }

]
// 异步路由
export const routes: Array<RouteRecordRaw> = [

]
// 额外路由 404
export const extraRoutes = [
  {
    path: '*',
    name: 'Error',
    component: () => import('@/views/Error/index.vue')
  }
]